<?php

    if($_GET['action']=='del' && $_GET['id']){
        mysql_query("DELETE FROM `SS_URL` WHERE `id`='".$_GET['id']."'") or die (db_error());;    
    }elseif($_GET['action']=='add' && $_POST['title'] && $_POST['url']){
        mysql_query("INSERT INTO `SS_URL` VALUES(NULL , '".$_POST['url']."', '".$_POST['title']."')") or die (db_error());;
    }

    $q = db_query("SELECT * FROM `SS_URL`");
    while ($row = db_fetch_row($q))
    $arResult[] = $row;
    
    //echo '<pre>'.print_r($arResult,1).'</pre>';
    
    $smarty->assign("arResult", $arResult);
    $smarty->assign("admin_sub_dpt", "modules_url.tpl.html");

?>